<%-- 
    Document   : product_detail
    Created on : Mar 12, 2013, 1:40:11 PM
    Author     : SonLK60201
--%>

<%@tag description="product detail form" pageEncoding="UTF-8"%>

<%-- The list of normal or fragment attributes can be specified here: --%>
<%@taglib uri="/struts-tags" prefix="s" %>

<%-- any content can be specified here e.g.: --%>
<h1 class="p">Product Details</h1>
<form action="productdetail.html" method="post">
    <div class="productDetails">
        <div class="productImage">
            <s:iterator value="product.images">
                <img src="<s:property value="url" />" alt="IMAGE OF PRODUCT" style="width: 75%"/>
                <br />
                <s:property value="description" />
                <br />
                <br />
            </s:iterator>

        </div>
        <div class="productInformation">
            <table border="0">
                <tbody>
                    <tr style="display: none;">
                        <td>Product Id:</td>
                        <td id="productInformation-id"><s:property value="product.id" /></td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Product Name:</td>
                        <td><s:property value="product.name" /></td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Description</td>
                        <td><s:property value="product.description" /></td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Quantity</td>
                        <td id="productInformation-quantity"><s:property value="product.quantity" /></td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Price ($)</td>
                        <td><s:property value="product.price" /></td>
                    </tr>
                    <tr>
                        <s:if test="#session.logined == true">
                            <s:if test="#session.isadmin == false">
                                <td colspan="2"><a id="productInformation-addCart" href="javascript:void(0);" onclick="addToCart(<s:property value="product.id" />, '<s:property value="product.name" />', '<s:property value="product.description" />', <s:property value="product.quantity" />, <s:property value="product.price" />, '<s:property value="product.images[0].url" />', this);"><img src="../resource/images/addcart.png" /> </a></td>
                                    </s:if>
                                </s:if>
                                <s:else>
                            <td colspan="2"><a id="productInformation-addCart" href="javascript:void(0);" onclick="addToCart(<s:property value="product.id" />, '<s:property value="product.name" />', '<s:property value="product.description" />', <s:property value="product.quantity" />, <s:property value="product.price" />, '<s:property value="product.images[0].url" />', this);"><img src="../resource/images/addcart.png" /> </a></td>
                                </s:else>
                    </tr>
                </tbody>
            </table>
        </div>
        <div style="clear: both" />
    </div>
</form>

